<?php /* Smarty version 2.6.19, created on 2009-01-02 12:15:37
         compiled from admin/admin_menus.tpl */ ?>
<?php echo '
  <script type="text/javascript">
<!--
function confirmDelete(articleId) {
if (confirm("This will delete this category. Continue?"))
document.location = "admin.php?page=menus&action=delcat&id=" + articleId;
}
function confirmDelete2(articleId, ids) {
if (confirm("This will delete this item (And any child items). Continue?"))
document.location = "admin.php?page=menus&action=delitem&rid=" + articleId + "&id=" + ids;
}

function show(id)
{
    document.getElementById(id).style.display = "";
}

function hide(id)
{
    document.getElementById(id).style.display = "none";
}


function showitems(id)
{
	var item = null;
    var item2 = null;
    var writediv = null;

    item = document.getElementById(\'sub\' + id);
    item2 = document.getElementById(\'subhide\' + id);

    if (item.style.display == "none")
    {
        item.style.display = "block";
        item2.style.display = "none";
        document.getElementById(\'close\'+id).style.display = "block";
        document.getElementById(\'open\'+id).style.display = "none";
    }
    else
    {
        item.style.display = "none";
        item2.style.display = "block";
        document.getElementById(\'close\'+id).style.display = "none";
        document.getElementById(\'open\'+id).style.display = "block";
    }

}
//-->
  </script>
  '; ?>

  <h2>Menu Manager</h2>
<?php if ($this->_tpl_vars['action'] == 'view' || $this->_tpl_vars['action'] == ""): ?>
<div id="navcontainer">

<h4 title="left">Left Menu</h4>
<div id="left">
<div class="toplinks"><?php if ($this->_tpl_vars['addallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=newcat&amp;side=left" title="Add menu"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/add.png" alt="Add menu" border="0" /></a>
<?php endif; ?><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=fixcat" title="Fix Positions"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/fix.png" alt="Fix Positions" border="0" /></a>
<?php endif; ?></div>
<table width="98%" cellpadding="0" cellspacing="0" border="0" align="center" class="table rowstyle-alt paginate-15" id="sortTable">
<thead>
  <tr>
    <th width="10%" scope="col" class="smallhead"></th>
    <th width="5%" class="smallhead">Publish</th>
    <th scope="col" class="smallhead">Name</th>
    <th width="5%" scope="col" class="smallhead">Items</th>
    <th width="10%" scope="col" class="smallhead">Position</th>
  </tr>
  </thead>
  <tbody>
  <?php unset($this->_sections['cats']);
$this->_sections['cats']['name'] = 'cats';
$this->_sections['cats']['loop'] = is_array($_loop=$this->_tpl_vars['numleft']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['cats']['show'] = true;
$this->_sections['cats']['max'] = $this->_sections['cats']['loop'];
$this->_sections['cats']['step'] = 1;
$this->_sections['cats']['start'] = $this->_sections['cats']['step'] > 0 ? 0 : $this->_sections['cats']['loop']-1;
if ($this->_sections['cats']['show']) {
    $this->_sections['cats']['total'] = $this->_sections['cats']['loop'];
    if ($this->_sections['cats']['total'] == 0)
        $this->_sections['cats']['show'] = false;
} else
    $this->_sections['cats']['total'] = 0;
if ($this->_sections['cats']['show']):

            for ($this->_sections['cats']['index'] = $this->_sections['cats']['start'], $this->_sections['cats']['iteration'] = 1;
                 $this->_sections['cats']['iteration'] <= $this->_sections['cats']['total'];
                 $this->_sections['cats']['index'] += $this->_sections['cats']['step'], $this->_sections['cats']['iteration']++):
$this->_sections['cats']['rownum'] = $this->_sections['cats']['iteration'];
$this->_sections['cats']['index_prev'] = $this->_sections['cats']['index'] - $this->_sections['cats']['step'];
$this->_sections['cats']['index_next'] = $this->_sections['cats']['index'] + $this->_sections['cats']['step'];
$this->_sections['cats']['first']      = ($this->_sections['cats']['iteration'] == 1);
$this->_sections['cats']['last']       = ($this->_sections['cats']['iteration'] == $this->_sections['cats']['total']);
?>
  <tr class="text">
    <td class="text"><div align="center"><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=catview&amp;id=<?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['id']; ?>
" title="Open <?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['name']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/mod.gif" border="0" alt="Open <?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['name']; ?>
" /></a>&nbsp;&nbsp;<?php if ($this->_tpl_vars['editallowed']): ?><a href="admin.php?page=menus&amp;action=editcat&amp;id=<?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['id']; ?>
" title="Edit <?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['name']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/edit.gif" border="0" alt="Edit <?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['name']; ?>
" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/edit_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?>&nbsp;&nbsp;<?php if ($this->_tpl_vars['deleteallowed']): ?><a href="javascript:confirmDelete(<?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['id']; ?>
)" title="Delete <?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['name']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/delete.gif" border="0" alt="Delete <?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['name']; ?>
" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/delete_grey.gif" border="0" alt="Deleting Disabled" title="Deleting Disabled" /><?php endif; ?></div></td>
    <td class="text"><div align="center"><?php if ($this->_tpl_vars['publishallowed']): ?><?php if ($this->_tpl_vars['left'][$this->_sections['cats']['index']]['published'] == 0): ?><a href="admin.php?page=menus&amp;action=publish&amp;id=<?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['id']; ?>
&amp;activetab=left"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/publish.png" border="0" alt="Publish <?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['name']; ?>
" title="Publish <?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['name']; ?>
" /></a><?php else: ?><a href="admin.php?page=menus&amp;action=unpublish&amp;id=<?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['id']; ?>
&amp;activetab=left"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/unpublish.png" border="0" alt="Unpublish <?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['name']; ?>
" title="Unpublish <?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['name']; ?>
" /></a><?php endif; ?><?php else: ?><?php if ($this->_tpl_vars['left'][$this->_sections['cats']['index']]['published'] == 0): ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/publish_grey.gif" border="0" alt="Not allowed to publish" title="Not allowed to publish" /><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/unpublish_grey.gif" border="0" alt="Not allowed to unpublish" title="Not allowed to unpublish" /><?php endif; ?><?php endif; ?></div></td>
    <td class="text"><?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['name']; ?>
</td>
    <td class="text"><?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['numitems']; ?>
</td>
    <td class="text"><div align="center"><?php if ($this->_sections['cats']['iteration'] != 1): ?><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=moveup&amp;id=<?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['id']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/up.gif" border="0" alt="Up" title="Move Up" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/up_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?><?php endif; ?><?php if ($this->_sections['cats']['iteration'] != $this->_tpl_vars['numleft']): ?><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=movedown&amp;id=<?php echo $this->_tpl_vars['left'][$this->_sections['cats']['index']]['id']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/down.gif" border="0" alt="Up" title="Move Down" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/down_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?><?php endif; ?></div></td>
  </tr>
  <?php endfor; else: ?>
  <tr>
  <td class="text" colspan="5">
   No menus on this side
  </td>
  </tr>
  <?php endif; ?>
  </tbody>
  </table>
</div>

<h4 title="right">Right Menu</h4>
<div id="right">
<div class="toplinks"><?php if ($this->_tpl_vars['addallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=newcat&amp;side=right" title="Add menu"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/add.png" alt="Add menu" border="0" /></a>
<?php endif; ?><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=fixcat" title="Fix Positions"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/fix.png" alt="Fix Positions" border="0" /></a><?php endif; ?></div>
<table width="98%" cellpadding="0" cellspacing="0" border="0" align="center" class="table rowstyle-alt paginate-15" id="sortTable1">
<thead>
  <tr>
    <th width="10%" scope="col" class="smallhead"></th>
    <th width="5%" class="smallhead">Publish</th>
    <th scope="col" class="smallhead">Name</th>
    <th width="5%" scope="col" class="smallhead">Items</th>
    <th width="10%" scope="col" class="smallhead">Position</th>
  </tr>
  </thead>
  <tbody>
  <?php unset($this->_sections['cats']);
$this->_sections['cats']['name'] = 'cats';
$this->_sections['cats']['loop'] = is_array($_loop=$this->_tpl_vars['numright']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['cats']['show'] = true;
$this->_sections['cats']['max'] = $this->_sections['cats']['loop'];
$this->_sections['cats']['step'] = 1;
$this->_sections['cats']['start'] = $this->_sections['cats']['step'] > 0 ? 0 : $this->_sections['cats']['loop']-1;
if ($this->_sections['cats']['show']) {
    $this->_sections['cats']['total'] = $this->_sections['cats']['loop'];
    if ($this->_sections['cats']['total'] == 0)
        $this->_sections['cats']['show'] = false;
} else
    $this->_sections['cats']['total'] = 0;
if ($this->_sections['cats']['show']):

            for ($this->_sections['cats']['index'] = $this->_sections['cats']['start'], $this->_sections['cats']['iteration'] = 1;
                 $this->_sections['cats']['iteration'] <= $this->_sections['cats']['total'];
                 $this->_sections['cats']['index'] += $this->_sections['cats']['step'], $this->_sections['cats']['iteration']++):
$this->_sections['cats']['rownum'] = $this->_sections['cats']['iteration'];
$this->_sections['cats']['index_prev'] = $this->_sections['cats']['index'] - $this->_sections['cats']['step'];
$this->_sections['cats']['index_next'] = $this->_sections['cats']['index'] + $this->_sections['cats']['step'];
$this->_sections['cats']['first']      = ($this->_sections['cats']['iteration'] == 1);
$this->_sections['cats']['last']       = ($this->_sections['cats']['iteration'] == $this->_sections['cats']['total']);
?>
  <tr class="text">
    <td class="text"><div align="center"><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=catview&amp;id=<?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['id']; ?>
" title="Open <?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['name']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/mod.gif" border="0" alt="Open <?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['name']; ?>
" /></a>&nbsp;&nbsp;<?php if ($this->_tpl_vars['editallowed']): ?><a href="admin.php?page=menus&amp;action=editcat&amp;id=<?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['id']; ?>
" title="Edit <?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['name']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/edit.gif" border="0" alt="Edit <?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['name']; ?>
" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/edit_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?>&nbsp;&nbsp;<?php if ($this->_tpl_vars['deleteallowed']): ?><a href="javascript:confirmDelete(<?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['id']; ?>
)" title="Delete <?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['name']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/delete.gif" border="0" alt="Delete <?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['name']; ?>
" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/delete_grey.gif" border="0" alt="Deleting Disabled" title="Deleting Disabled" /><?php endif; ?></div></td>
    <td class="text"><div align="center"><?php if ($this->_tpl_vars['publishallowed']): ?><?php if ($this->_tpl_vars['right'][$this->_sections['cats']['index']]['published'] == 0): ?><a href="admin.php?page=menus&amp;action=publish&amp;id=<?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['id']; ?>
&amp;activetab=right"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/publish.png" border="0" alt="Publish <?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['name']; ?>
" title="Publish <?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['name']; ?>
" /></a><?php else: ?><a href="admin.php?page=menus&amp;action=unpublish&amp;id=<?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['id']; ?>
&amp;activetab=right"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/unpublish.png" border="0" alt="Unpublish <?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['name']; ?>
" title="Unpublish <?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['name']; ?>
" /></a><?php endif; ?><?php else: ?><?php if ($this->_tpl_vars['right'][$this->_sections['cats']['index']]['published'] == 0): ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/publish_grey.gif" border="0" alt="Not allowed to publish" title="Not allowed to publish" /><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/unpublish_grey.gif" border="0" alt="Not allowed to unpublish" title="Not allowed to unpublish" /><?php endif; ?><?php endif; ?></div></td>
    <td class="text"><?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['name']; ?>
</td>
    <td class="text"><?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['numitems']; ?>
</td>
    <td class="text"><div align="center"><?php if ($this->_sections['cats']['iteration'] != 1): ?><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=moveup&amp;id=<?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['id']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/up.gif" border="0" alt="Up" title="Move Up" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/up_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?><?php endif; ?><?php if ($this->_sections['cats']['iteration'] != $this->_tpl_vars['numright']): ?><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=movedown&amp;id=<?php echo $this->_tpl_vars['right'][$this->_sections['cats']['index']]['id']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/down.gif" border="0" alt="Up" title="Move Down" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/down_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?><?php endif; ?></div></td>
  </tr> 
  <?php endfor; else: ?>
  <tr>
  <td class="text" colspan="5">
   No menus on this side
  </td>
  </tr>
  <?php endif; ?>
    </tbody>
  </table>
</div>

<h4 title="top">Top Menu</h4>
<div id="top">
<div class="toplinks"><?php if ($this->_tpl_vars['addallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=newcat&amp;side=top" title="Add menu"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/add.png" alt="Add menu" border="0" /></a>
<?php endif; ?><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=fixcat" title="Fix Positions"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/fix.png" alt="Fix Positions" border="0" /></a>
<?php endif; ?></div>
<table width="98%" cellpadding="0" cellspacing="0" border="0" align="center" class="table rowstyle-alt paginate-15" id="sortTable2">
<thead>
  <tr>
    <th width="10%" class="smallhead"></th>
    <th width="5%" class="smallhead">Publish</th>
    <th scope="col" class="smallhead">Name</th>
    <th width="5%" scope="col" class="smallhead">Items</th>
    <th width="10%" scope="col" class="smallhead">Position</th>
  </tr>
  </thead>
  <tbody>
  <?php unset($this->_sections['cats']);
$this->_sections['cats']['name'] = 'cats';
$this->_sections['cats']['loop'] = is_array($_loop=$this->_tpl_vars['numtop']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['cats']['show'] = true;
$this->_sections['cats']['max'] = $this->_sections['cats']['loop'];
$this->_sections['cats']['step'] = 1;
$this->_sections['cats']['start'] = $this->_sections['cats']['step'] > 0 ? 0 : $this->_sections['cats']['loop']-1;
if ($this->_sections['cats']['show']) {
    $this->_sections['cats']['total'] = $this->_sections['cats']['loop'];
    if ($this->_sections['cats']['total'] == 0)
        $this->_sections['cats']['show'] = false;
} else
    $this->_sections['cats']['total'] = 0;
if ($this->_sections['cats']['show']):

            for ($this->_sections['cats']['index'] = $this->_sections['cats']['start'], $this->_sections['cats']['iteration'] = 1;
                 $this->_sections['cats']['iteration'] <= $this->_sections['cats']['total'];
                 $this->_sections['cats']['index'] += $this->_sections['cats']['step'], $this->_sections['cats']['iteration']++):
$this->_sections['cats']['rownum'] = $this->_sections['cats']['iteration'];
$this->_sections['cats']['index_prev'] = $this->_sections['cats']['index'] - $this->_sections['cats']['step'];
$this->_sections['cats']['index_next'] = $this->_sections['cats']['index'] + $this->_sections['cats']['step'];
$this->_sections['cats']['first']      = ($this->_sections['cats']['iteration'] == 1);
$this->_sections['cats']['last']       = ($this->_sections['cats']['iteration'] == $this->_sections['cats']['total']);
?>
  <tr class="text">
    <td class="text"><div align="center"><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=catview&amp;id=<?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['id']; ?>
" title="Open <?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['name']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/mod.gif" border="0" alt="Open <?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['name']; ?>
" /></a>&nbsp;&nbsp;<?php if ($this->_tpl_vars['editallowed']): ?><a href="admin.php?page=menus&amp;action=editcat&amp;id=<?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['id']; ?>
" title="Edit <?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['name']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/edit.gif" border="0" alt="Edit <?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['name']; ?>
" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/edit_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?>&nbsp;&nbsp;<?php if ($this->_tpl_vars['deleteallowed']): ?><a href="javascript:confirmDelete(<?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['id']; ?>
)" title="Delete <?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['name']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/delete.gif" border="0" alt="Delete <?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['name']; ?>
" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/delete_grey.gif" border="0" alt="Deleting Disabled" title="Deleting Disabled" /><?php endif; ?></div></td>
    <td class="text"><div align="center"><?php if ($this->_tpl_vars['publishallowed']): ?><?php if ($this->_tpl_vars['top'][$this->_sections['cats']['index']]['published'] == 0): ?><a href="admin.php?page=menus&amp;action=publish&amp;id=<?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['id']; ?>
&amp;activetab=top"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/publish.png" border="0" alt="Publish <?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['name']; ?>
" title="Publish <?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['name']; ?>
" /></a><?php else: ?><a href="admin.php?page=menus&amp;action=unpublish&amp;id=<?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['id']; ?>
&amp;activetab=top"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/unpublish.png" border="0" alt="Unpublish <?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['name']; ?>
" title="Unpublish <?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['name']; ?>
" /></a><?php endif; ?><?php else: ?><?php if ($this->_tpl_vars['top'][$this->_sections['cats']['index']]['published'] == 0): ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/publish_grey.gif" border="0" alt="Not allowed to publish" title="Not allowed to publish" /><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/unpublish_grey.gif" border="0" alt="Not allowed to unpublish" title="Not allowed to unpublish" /><?php endif; ?><?php endif; ?></div></td>
    <td class="text"><?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['name']; ?>
</td>
    <td class="text"><?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['numitems']; ?>
</td>
    <td class="text"><div align="center"><?php if ($this->_sections['cats']['iteration'] != 1): ?><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=moveup&amp;id=<?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['id']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/up.gif" border="0" alt="Up" title="Move Up" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/up_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?><?php endif; ?><?php if ($this->_sections['cats']['iteration'] != $this->_tpl_vars['numtop']): ?><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=movedown&amp;id=<?php echo $this->_tpl_vars['top'][$this->_sections['cats']['index']]['id']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/down.gif" border="0" alt="Up" title="Move Down" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/down_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?><?php endif; ?></div></td>
  </tr>
      <?php endfor; else: ?>
  <tr>
  <td class="text" colspan="5">
   No menus on this side
  </td>
  </tr>
  <?php endif; ?>
  </tbody>
</table>
</div>
</div>
  <?php elseif ($this->_tpl_vars['action'] == 'catview'): ?><div class="toplinks"><?php if ($this->_tpl_vars['addallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=newitem&amp;id=<?php echo $this->_tpl_vars['menu']['id']; ?>
" title="Add item"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/add.png" alt="Add item" border="0" /></a>
<?php endif; ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;activetab=<?php echo $this->_tpl_vars['menu']['side']; ?>
" title="Back"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/back.png" alt="Back" border="0" /></a></div>
  <?php if ($this->_tpl_vars['numitems'] > 0): ?>
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="table rowstyle-alt paginate-15" id="sortTable3">
<thead>
  <tr>
    <th width="10%" scope="col" class="smallhead"></th>
    <th scope="col" class="smallhead">Name</th>
    <th width="41%" scope="col" class="smallhead">Action of item</th>
    <th width="10%" scope="col" class="smallhead">Position</th>
  </tr>
  </thead>
  <tbody>
<?php unset($this->_sections['items']);
$this->_sections['items']['name'] = 'items';
$this->_sections['items']['loop'] = is_array($_loop=$this->_tpl_vars['numitems']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['items']['show'] = true;
$this->_sections['items']['max'] = $this->_sections['items']['loop'];
$this->_sections['items']['step'] = 1;
$this->_sections['items']['start'] = $this->_sections['items']['step'] > 0 ? 0 : $this->_sections['items']['loop']-1;
if ($this->_sections['items']['show']) {
    $this->_sections['items']['total'] = $this->_sections['items']['loop'];
    if ($this->_sections['items']['total'] == 0)
        $this->_sections['items']['show'] = false;
} else
    $this->_sections['items']['total'] = 0;
if ($this->_sections['items']['show']):

            for ($this->_sections['items']['index'] = $this->_sections['items']['start'], $this->_sections['items']['iteration'] = 1;
                 $this->_sections['items']['iteration'] <= $this->_sections['items']['total'];
                 $this->_sections['items']['index'] += $this->_sections['items']['step'], $this->_sections['items']['iteration']++):
$this->_sections['items']['rownum'] = $this->_sections['items']['iteration'];
$this->_sections['items']['index_prev'] = $this->_sections['items']['index'] - $this->_sections['items']['step'];
$this->_sections['items']['index_next'] = $this->_sections['items']['index'] + $this->_sections['items']['step'];
$this->_sections['items']['first']      = ($this->_sections['items']['iteration'] == 1);
$this->_sections['items']['last']       = ($this->_sections['items']['iteration'] == $this->_sections['items']['total']);
?>
  <tr class="text">
    <td class="text"><div align="center"><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=edititem&amp;cid=<?php echo $this->_tpl_vars['menu']['id']; ?>
&amp;id=<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['id']; ?>
" title="Edit <?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['name']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/edit.gif" border="0" alt="Edit <?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['name']; ?>
" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/edit_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?>&nbsp;&nbsp;<?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=moveitem&amp;cid=<?php echo $this->_tpl_vars['menu']['id']; ?>
&amp;id=<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['id']; ?>
" title="Move <?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['name']; ?>
 to a different menu"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/move.gif" border="0" alt="Move <?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['name']; ?>
 to a different menu" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/move_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?>&nbsp;&nbsp;<?php if ($this->_tpl_vars['deleteallowed']): ?><a href="javascript:confirmDelete2(<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['id']; ?>
,<?php echo $this->_tpl_vars['menu']['id']; ?>
)" title="Delete <?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['name']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/delete.gif" border="0" alt="Delete <?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['name']; ?>
"  /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/delete_grey.gif" border="0" alt="Deleting Disabled" title="Deleting Disabled" /><?php endif; ?></div></td>
    <td class="text"><div align="left"><?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['name']; ?>
</div></td>
    <td class="text"><?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['action']; ?>
</td>
    <td class="text"><div align="center"><?php if ($this->_sections['items']['iteration'] != 1): ?><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=moveitemup&amp;id=<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['id']; ?>
&amp;cid=<?php echo $this->_tpl_vars['menu']['id']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/up.gif" border="0" alt="Up" title="Move Up" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/up_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?>&nbsp;<?php endif; ?><?php if ($this->_sections['items']['iteration'] != $this->_tpl_vars['numitems']): ?><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=moveitemdown&amp;id=<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['id']; ?>
&amp;cid=<?php echo $this->_tpl_vars['menu']['id']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/down.gif" border="0" alt="Up" title="Move Down" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/down_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?><?php endif; ?></div></td>
  </tr>
  <?php if ($this->_tpl_vars['item'][$this->_sections['items']['index']]['subnumber'] > 0): ?>
  <tr>
   <td class="text" valign="top"><div align="center"><div id="open<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['id']; ?>
"><a href="javascript:showitems('<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['id']; ?>
');" class="hintanchor2"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/close.png" title="[+]" border="0"/></a></div><div id="close<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['id']; ?>
" style="display:none;"><a href="javascript:showitems('<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['id']; ?>
');" class="hintanchor2"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/open.png" title="[-]" border="0"/></a></div></div></td>
   <td colspan="3" class="text">
   <div id="subhide<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['id']; ?>
" style="display:'';">
    <div align="left">&nbsp;Item has <b><?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['subnumber']; ?>
</b> sub menu item(s).</div>
   </div>
   <div id="sub<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['id']; ?>
" style="display:none;">
    <strong><div align="left">Sub menu item(s)</div></strong>
    <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="table rowstyle-alt" id="sortTable3">
<thead>
      <tr>
    <th width="8%" scope="col" class="smallhead"></th>
    <th scope="col" class="smallhead">Name</th>
    <th width="40%" scope="col" class="smallhead">Action of item</th>
    <th width="10%" scope="col" class="smallhead">Position</th>
  </tr>
  </thead>
  <tbody>
  <?php unset($this->_sections['subitem']);
$this->_sections['subitem']['name'] = 'subitem';
$this->_sections['subitem']['loop'] = is_array($_loop=$this->_tpl_vars['item'][$this->_sections['items']['index']]['subnumber']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['subitem']['show'] = true;
$this->_sections['subitem']['max'] = $this->_sections['subitem']['loop'];
$this->_sections['subitem']['step'] = 1;
$this->_sections['subitem']['start'] = $this->_sections['subitem']['step'] > 0 ? 0 : $this->_sections['subitem']['loop']-1;
if ($this->_sections['subitem']['show']) {
    $this->_sections['subitem']['total'] = $this->_sections['subitem']['loop'];
    if ($this->_sections['subitem']['total'] == 0)
        $this->_sections['subitem']['show'] = false;
} else
    $this->_sections['subitem']['total'] = 0;
if ($this->_sections['subitem']['show']):

            for ($this->_sections['subitem']['index'] = $this->_sections['subitem']['start'], $this->_sections['subitem']['iteration'] = 1;
                 $this->_sections['subitem']['iteration'] <= $this->_sections['subitem']['total'];
                 $this->_sections['subitem']['index'] += $this->_sections['subitem']['step'], $this->_sections['subitem']['iteration']++):
$this->_sections['subitem']['rownum'] = $this->_sections['subitem']['iteration'];
$this->_sections['subitem']['index_prev'] = $this->_sections['subitem']['index'] - $this->_sections['subitem']['step'];
$this->_sections['subitem']['index_next'] = $this->_sections['subitem']['index'] + $this->_sections['subitem']['step'];
$this->_sections['subitem']['first']      = ($this->_sections['subitem']['iteration'] == 1);
$this->_sections['subitem']['last']       = ($this->_sections['subitem']['iteration'] == $this->_sections['subitem']['total']);
?>
  <tr class="text">
    <td class="text"><div align="center"><?php if ($this->_tpl_vars['editallowed']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=edititem&amp;cid=<?php echo $this->_tpl_vars['menu']['id']; ?>
&amp;id=<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['subitems'][$this->_sections['subitem']['index']]['id']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/edit.gif" border="0" alt="Edit <?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['subitems'][$this->_sections['subitem']['index']]['name']; ?>
" title="Edit <?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['subitems'][$this->_sections['subitem']['index']]['name']; ?>
" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/edit_grey.gif" border="0" alt="Editing Disabled" title="Editing Disabled" /><?php endif; ?>&nbsp;&nbsp;<?php if ($this->_tpl_vars['deleteallowed']): ?><a href="javascript:confirmDelete2(<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['subitems'][$this->_sections['subitem']['index']]['id']; ?>
,<?php echo $this->_tpl_vars['menu']['id']; ?>
)"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/delete.gif" border="0" alt="Delete <?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['subitems'][$this->_sections['subitem']['index']]['name']; ?>
" title="Delete <?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['subitems'][$this->_sections['subitem']['index']]['name']; ?>
" /></a><?php else: ?><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/delete_grey.gif" border="0" alt="Deleting Disabled" title="Deleting Disabled" /><?php endif; ?></div></td>
    <td class="text"><?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['subitems'][$this->_sections['subitem']['index']]['name']; ?>
</td>
    <td class="text"><?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['subitems'][$this->_sections['subitem']['index']]['action']; ?>
</td>
    <td class="text"><div align="center"><?php if ($this->_sections['subitem']['iteration'] != 1): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=moveitemup&amp;id=<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['subitems'][$this->_sections['subitem']['index']]['id']; ?>
&amp;cid=<?php echo $this->_tpl_vars['menu']['id']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/up.gif" border="0" alt="Up" title="Move Up" /></a>&nbsp;<?php endif; ?><?php if ($this->_sections['subitem']['iteration'] != $this->_tpl_vars['item'][$this->_sections['items']['index']]['subnumber']): ?><a href="<?php echo $this->_tpl_vars['pagename']; ?>
&amp;action=moveitemdown&amp;id=<?php echo $this->_tpl_vars['item'][$this->_sections['items']['index']]['subitems'][$this->_sections['subitem']['index']]['id']; ?>
&amp;cid=<?php echo $this->_tpl_vars['menu']['id']; ?>
"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/down.gif" border="0" alt="Up" title="Move Down" /></a><?php endif; ?></div></td>
  </tr>
   <?php endfor; endif; ?>
   </tbody>
   </table>
   </div>
   </td>
   </tr>
  <?php endif; ?>
 <?php endfor; endif; ?>
 </tbody>
</table>
<?php else: ?>
<div align="center">No menu items in <?php echo $this->_tpl_vars['menu']['name']; ?>
</div>
<?php endif; ?>
  <?php elseif ($this->_tpl_vars['action'] == 'newcat' || $this->_tpl_vars['action'] == 'editcat'): ?>
  <script type="text/javascript">
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "../scripts/validator.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</script>
<?php echo '
  <script type="text/javascript">
<!--
function checkAll(type) 
{
    '; ?>
itemList = [<?php unset($this->_sections['groups']);
$this->_sections['groups']['name'] = 'groups';
$this->_sections['groups']['loop'] = is_array($_loop=$this->_tpl_vars['numgroups']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['groups']['show'] = true;
$this->_sections['groups']['max'] = $this->_sections['groups']['loop'];
$this->_sections['groups']['step'] = 1;
$this->_sections['groups']['start'] = $this->_sections['groups']['step'] > 0 ? 0 : $this->_sections['groups']['loop']-1;
if ($this->_sections['groups']['show']) {
    $this->_sections['groups']['total'] = $this->_sections['groups']['loop'];
    if ($this->_sections['groups']['total'] == 0)
        $this->_sections['groups']['show'] = false;
} else
    $this->_sections['groups']['total'] = 0;
if ($this->_sections['groups']['show']):

            for ($this->_sections['groups']['index'] = $this->_sections['groups']['start'], $this->_sections['groups']['iteration'] = 1;
                 $this->_sections['groups']['iteration'] <= $this->_sections['groups']['total'];
                 $this->_sections['groups']['index'] += $this->_sections['groups']['step'], $this->_sections['groups']['iteration']++):
$this->_sections['groups']['rownum'] = $this->_sections['groups']['iteration'];
$this->_sections['groups']['index_prev'] = $this->_sections['groups']['index'] - $this->_sections['groups']['step'];
$this->_sections['groups']['index_next'] = $this->_sections['groups']['index'] + $this->_sections['groups']['step'];
$this->_sections['groups']['first']      = ($this->_sections['groups']['iteration'] == 1);
$this->_sections['groups']['last']       = ($this->_sections['groups']['iteration'] == $this->_sections['groups']['total']);
?>'<?php echo $this->_tpl_vars['group'][$this->_sections['groups']['index']]['id']; ?>
'<?php if ($this->_sections['groups']['iteration'] < $this->_tpl_vars['numgroups']): ?>,<?php endif; ?><?php endfor; endif; ?>];
    number = <?php echo $this->_tpl_vars['numgroups']; ?>
;<?php echo '

    for (i=0;i<number;i++)
    {
        document.getElementById(type + itemList[i]).checked = document.getElementById(\'all\'+type).checked;
    }
}

//-->
</script>
  '; ?>
  
  <div align="center">
<form name="form1" method="post" action="" onsubmit="return checkForm([['name','text',true,0,0,'']]);">
  <fieldset class="formlist">
  <legend><?php if ($this->_tpl_vars['action'] == 'newcat'): ?>Add<?php else: ?>Edit<?php endif; ?> Menu</legend>
  <div class="field">
  <label for="name" class="label">Name of Category<span class="hintanchor" title="Name of the menu."><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/help.png" alt="[?]"/></span></label>
    <div class="inputboxwrapper"><input name="name" type="text" id="name" value="<?php echo $this->_tpl_vars['menu']['name']; ?>
" class="inputbox" onblur="checkElement('name', 'text', true, 0, 0, '');" /><br /><span class="fieldError" id="nameError">Required</span></div><br />
    
    <label for="location" class="label">Location<span class="hintanchor" title="The location of this menu."><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/help.png" alt="[?]"/></span></label>
    <div class="inputboxwrapper">
    <select name="location" id="location" class="inputbox">
        <option value="left" <?php if ($this->_tpl_vars['menu']['side'] == 'left' || $this->_tpl_vars['menu']['side'] == '' || $this->_tpl_vars['side'] == 'left'): ?>selected="selected"<?php endif; ?>>Left Hand Menu</option>
        <option value="right" <?php if ($this->_tpl_vars['menu']['side'] == 'right' || $this->_tpl_vars['side'] == 'right'): ?>selected="selected"<?php endif; ?>>Right Hand Menu</option>
        <option value="top" <?php if ($this->_tpl_vars['menu']['side'] == 'top' || $this->_tpl_vars['side'] == 'top'): ?>selected="selected"<?php endif; ?>>Top Menu</option>
    </select></div><br />
    
    
    <label for="show" class="label">Heading<span class="hintanchor" title="Should the category name be shown as the heading."><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/help.png" alt="[?]"/></span></label>
        <div class="inputboxwrapper">
    <select name="show" id="show" class="inputbox">
        <option value="1" <?php if ($this->_tpl_vars['menu']['showhead'] == 1 || $this->_tpl_vars['menu']['showhead'] == ''): ?>selected="selected"<?php endif; ?>>Show Heading</option>
        <option value="0" <?php if ($this->_tpl_vars['menu']['showhead'] == 0): ?>selected="selected"<?php endif; ?>>Hide Heading</option>
    </select></div><br />    
    
    <label for="showperm" class="label">Show<span class="hintanchor" title="Under what circumstances should this menu be shown"><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/help.png" alt="[?]"/></span></label>
    <div class="inputboxwrapper">
    <select name="showperm" id="showperm" class="inputbox">
        <option value="0" <?php if ($this->_tpl_vars['menu']['showwhen'] == 0): ?>selected="selected"<?php endif; ?>>Always Show</option>
        <option value="1" <?php if ($this->_tpl_vars['menu']['showwhen'] == 1): ?>selected="selected"<?php endif; ?>>Show when logged in</option>
        <option value="2" <?php if ($this->_tpl_vars['menu']['showwhen'] == 2): ?>selected="selected"<?php endif; ?>>Show when logged out</option>
    </select></div><br />    
    
    <label for="expanded" class="label">Sub menu items<span class="hintanchor" title="Under what circumstances should submenu items be shown."><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/help.png" alt="[?]"/></span></label>
    <div class="inputboxwrapper">
    <select name="expanded" id="expanded" class="inputbox">
        <option value="1" <?php if ($this->_tpl_vars['menu']['expanded'] == 1): ?>selected="selected"<?php endif; ?>>Always show</option>
        <option value="0" <?php if ($this->_tpl_vars['menu']['expanded'] == 0): ?>selected="selected"<?php endif; ?>>Only show when parent item is active</option>
    </select></div><br />

      <span class="label">Groups<span class="hintanchor" title="Groups that can see this menu. Only applies if the menu is set to only show when logged in."><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/help.png" alt="[?]"/></span></span>
       <div class="inputboxwrapper"><ul class="checklist">
      <li><label for="allgroups"><input type="checkbox" value="1" id="allgroups" onclick="checkAll('groups');" />Select/Unselect All</label></li>
      <?php unset($this->_sections['groups']);
$this->_sections['groups']['name'] = 'groups';
$this->_sections['groups']['loop'] = is_array($_loop=$this->_tpl_vars['numgroups']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['groups']['show'] = true;
$this->_sections['groups']['max'] = $this->_sections['groups']['loop'];
$this->_sections['groups']['step'] = 1;
$this->_sections['groups']['start'] = $this->_sections['groups']['step'] > 0 ? 0 : $this->_sections['groups']['loop']-1;
if ($this->_sections['groups']['show']) {
    $this->_sections['groups']['total'] = $this->_sections['groups']['loop'];
    if ($this->_sections['groups']['total'] == 0)
        $this->_sections['groups']['show'] = false;
} else
    $this->_sections['groups']['total'] = 0;
if ($this->_sections['groups']['show']):

            for ($this->_sections['groups']['index'] = $this->_sections['groups']['start'], $this->_sections['groups']['iteration'] = 1;
                 $this->_sections['groups']['iteration'] <= $this->_sections['groups']['total'];
                 $this->_sections['groups']['index'] += $this->_sections['groups']['step'], $this->_sections['groups']['iteration']++):
$this->_sections['groups']['rownum'] = $this->_sections['groups']['iteration'];
$this->_sections['groups']['index_prev'] = $this->_sections['groups']['index'] - $this->_sections['groups']['step'];
$this->_sections['groups']['index_next'] = $this->_sections['groups']['index'] + $this->_sections['groups']['step'];
$this->_sections['groups']['first']      = ($this->_sections['groups']['iteration'] == 1);
$this->_sections['groups']['last']       = ($this->_sections['groups']['iteration'] == $this->_sections['groups']['total']);
?>
        <?php $this->assign('id', $this->_tpl_vars['group'][$this->_sections['groups']['index']]['id']); ?>
        <li><label for="groups<?php echo $this->_tpl_vars['group'][$this->_sections['groups']['index']]['id']; ?>
"><input type="checkbox" value="1" name="groups[<?php echo $this->_tpl_vars['group'][$this->_sections['groups']['index']]['id']; ?>
]" id="groups<?php echo $this->_tpl_vars['group'][$this->_sections['groups']['index']]['id']; ?>
" <?php if ($this->_tpl_vars['menu']['groups'][$this->_tpl_vars['id']] == 1): ?>checked="checked"<?php endif; ?> /><?php echo $this->_tpl_vars['group'][$this->_sections['groups']['index']]['teamname']; ?>
</label></li>
      <?php endfor; endif; ?>
      </ul></div><br />

    <div class="submitWrapper"><input type="submit" name="Submit" value="Submit" class="button" />
     <input name="Cancel" type="button" id="Cancel" value="Cancel" onclick="history.go(-1);" class="button" /></div>
</form>
</div>
<?php elseif ($this->_tpl_vars['action'] == 'newitem' || $this->_tpl_vars['action'] == 'edititem'): ?>
  <script type="text/javascript">
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "../scripts/validator.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<?php echo '
function itemss()
{
    var urlenabled = '; ?>
<?php if ($this->_tpl_vars['numpages'] > 0): ?>true<?php else: ?>false<?php endif; ?><?php echo ';
    if (document.form2.items.selectedIndex==0 && urlenabled == true)
    {
        show(\'urldiv\');
        hide(\'optiondiv\');
    }
    else
    {
        hide(\'urldiv\');
        show(\'optiondiv\');
        var url = "admin/get_menu_options_ajax.php";
        var myAjax1 = new Ajax(url, {method: \'get\',update: $(\'optiondiv\')}).request(document.form2.items.value);
    }
}
'; ?>

</script>
   <div align="center">
<form name="form2" method="post" action="" onsubmit="return checkForm([['name','text',true,0,0,'']]);">
<fieldset class="formlist">
<legend><?php if ($this->_tpl_vars['action'] == 'newitem'): ?>Add<?php else: ?>Edit<?php endif; ?> Item</legend>
<div class="field">
<label for="name" class="label">Name<span class="hintanchor" title="Name of menu item."><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/help.png" alt="[?]"/></span></label>
<div class="inputboxwrapper"><input name="name" type="text" id="name" value="<?php echo $this->_tpl_vars['item']['name']; ?>
" class="inputbox" size="50" onblur="checkElement('name', 'text', true, 0, 0, '');" /><br /><span class="fieldError" id="nameError">Required</span></div><br />
    
    <?php if ($this->_tpl_vars['numparents'] > 0): ?>
    <label for="parent" class="label">Parent<span class="hintanchor" title="Parent menu item, makes this item a sub menu item."><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/help.png" alt="[?]"/></span></label>
    <div class="inputboxwrapper"><select name="parent" id="parent" class="inputbox">
    <option value="0" <?php if ($this->_tpl_vars['item']['parent'] == '' || $this->_tpl_vars['item']['parent'] == 'top'): ?>selected="selected"<?php endif; ?>>Top</option>
    <?php unset($this->_sections['parents']);
$this->_sections['parents']['name'] = 'parents';
$this->_sections['parents']['loop'] = is_array($_loop=$this->_tpl_vars['numparents']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['parents']['show'] = true;
$this->_sections['parents']['max'] = $this->_sections['parents']['loop'];
$this->_sections['parents']['step'] = 1;
$this->_sections['parents']['start'] = $this->_sections['parents']['step'] > 0 ? 0 : $this->_sections['parents']['loop']-1;
if ($this->_sections['parents']['show']) {
    $this->_sections['parents']['total'] = $this->_sections['parents']['loop'];
    if ($this->_sections['parents']['total'] == 0)
        $this->_sections['parents']['show'] = false;
} else
    $this->_sections['parents']['total'] = 0;
if ($this->_sections['parents']['show']):

            for ($this->_sections['parents']['index'] = $this->_sections['parents']['start'], $this->_sections['parents']['iteration'] = 1;
                 $this->_sections['parents']['iteration'] <= $this->_sections['parents']['total'];
                 $this->_sections['parents']['index'] += $this->_sections['parents']['step'], $this->_sections['parents']['iteration']++):
$this->_sections['parents']['rownum'] = $this->_sections['parents']['iteration'];
$this->_sections['parents']['index_prev'] = $this->_sections['parents']['index'] - $this->_sections['parents']['step'];
$this->_sections['parents']['index_next'] = $this->_sections['parents']['index'] + $this->_sections['parents']['step'];
$this->_sections['parents']['first']      = ($this->_sections['parents']['iteration'] == 1);
$this->_sections['parents']['last']       = ($this->_sections['parents']['iteration'] == $this->_sections['parents']['total']);
?>
     <option value="<?php echo $this->_tpl_vars['parent'][$this->_sections['parents']['index']]['id']; ?>
" <?php if ($this->_tpl_vars['item']['parent'] == $this->_tpl_vars['parent'][$this->_sections['parents']['index']]['id']): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['parent'][$this->_sections['parents']['index']]['name']; ?>
</option>
    <?php endfor; endif; ?>
    </select></div><br />
    <?php endif; ?>
     <label for="items" class="label">Item<span class="hintanchor" title="Location of link."><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/help.png" alt="[?]"/></span></label> 
    <div class="inputboxwrapper"><select name="items" id="items" class="inputbox" onchange="itemss();">
      <option value="url" <?php if ($this->_tpl_vars['item']['type'] == 5 || $this->_tpl_vars['item'] == ''): ?>selected="selected"<?php endif; ?>>External Link</option>
      <optgroup label="Static Pages">
      <?php unset($this->_sections['pages']);
$this->_sections['pages']['name'] = 'pages';
$this->_sections['pages']['loop'] = is_array($_loop=$this->_tpl_vars['numpages']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['pages']['show'] = true;
$this->_sections['pages']['max'] = $this->_sections['pages']['loop'];
$this->_sections['pages']['step'] = 1;
$this->_sections['pages']['start'] = $this->_sections['pages']['step'] > 0 ? 0 : $this->_sections['pages']['loop']-1;
if ($this->_sections['pages']['show']) {
    $this->_sections['pages']['total'] = $this->_sections['pages']['loop'];
    if ($this->_sections['pages']['total'] == 0)
        $this->_sections['pages']['show'] = false;
} else
    $this->_sections['pages']['total'] = 0;
if ($this->_sections['pages']['show']):

            for ($this->_sections['pages']['index'] = $this->_sections['pages']['start'], $this->_sections['pages']['iteration'] = 1;
                 $this->_sections['pages']['iteration'] <= $this->_sections['pages']['total'];
                 $this->_sections['pages']['index'] += $this->_sections['pages']['step'], $this->_sections['pages']['iteration']++):
$this->_sections['pages']['rownum'] = $this->_sections['pages']['iteration'];
$this->_sections['pages']['index_prev'] = $this->_sections['pages']['index'] - $this->_sections['pages']['step'];
$this->_sections['pages']['index_next'] = $this->_sections['pages']['index'] + $this->_sections['pages']['step'];
$this->_sections['pages']['first']      = ($this->_sections['pages']['iteration'] == 1);
$this->_sections['pages']['last']       = ($this->_sections['pages']['iteration'] == $this->_sections['pages']['total']);
?>
        <option value="<?php echo $this->_tpl_vars['page'][$this->_sections['pages']['index']]['id']; ?>
.stat" <?php if ($this->_tpl_vars['item']['item'] == $this->_tpl_vars['page'][$this->_sections['pages']['index']]['id'] && $this->_tpl_vars['item']['type'] == 1): ?>selected="selected"<?php endif; ?>><?php if ($this->_tpl_vars['page'][$this->_sections['pages']['index']]['friendly'] == ""): ?><?php echo $this->_tpl_vars['page'][$this->_sections['pages']['index']]['name']; ?>
<?php else: ?><?php echo $this->_tpl_vars['page'][$this->_sections['pages']['index']]['friendly']; ?>
<?php endif; ?></option> 
     <?php endfor; endif; ?>	  
     </optgroup>
    <optgroup label="Dynamic Pages">
      <?php unset($this->_sections['function']);
$this->_sections['function']['name'] = 'function';
$this->_sections['function']['loop'] = is_array($_loop=$this->_tpl_vars['numfunc']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['function']['show'] = true;
$this->_sections['function']['max'] = $this->_sections['function']['loop'];
$this->_sections['function']['step'] = 1;
$this->_sections['function']['start'] = $this->_sections['function']['step'] > 0 ? 0 : $this->_sections['function']['loop']-1;
if ($this->_sections['function']['show']) {
    $this->_sections['function']['total'] = $this->_sections['function']['loop'];
    if ($this->_sections['function']['total'] == 0)
        $this->_sections['function']['show'] = false;
} else
    $this->_sections['function']['total'] = 0;
if ($this->_sections['function']['show']):

            for ($this->_sections['function']['index'] = $this->_sections['function']['start'], $this->_sections['function']['iteration'] = 1;
                 $this->_sections['function']['iteration'] <= $this->_sections['function']['total'];
                 $this->_sections['function']['index'] += $this->_sections['function']['step'], $this->_sections['function']['iteration']++):
$this->_sections['function']['rownum'] = $this->_sections['function']['iteration'];
$this->_sections['function']['index_prev'] = $this->_sections['function']['index'] - $this->_sections['function']['step'];
$this->_sections['function']['index_next'] = $this->_sections['function']['index'] + $this->_sections['function']['step'];
$this->_sections['function']['first']      = ($this->_sections['function']['iteration'] == 1);
$this->_sections['function']['last']       = ($this->_sections['function']['iteration'] == $this->_sections['function']['total']);
?>
      <?php if ($this->_tpl_vars['func'][$this->_sections['function']['index']]['type'] == 2): ?><option value="<?php echo $this->_tpl_vars['func'][$this->_sections['function']['index']]['id']; ?>
.dyn" <?php if ($this->_tpl_vars['item']['item'] == $this->_tpl_vars['func'][$this->_sections['function']['index']]['id'] && $this->_tpl_vars['item']['type'] == 2): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['func'][$this->_sections['function']['index']]['name']; ?>
</option><?php endif; ?>
      <?php endfor; endif; ?>
      </optgroup>
     <optgroup label="Articles">
      <?php unset($this->_sections['pages']);
$this->_sections['pages']['name'] = 'pages';
$this->_sections['pages']['loop'] = is_array($_loop=$this->_tpl_vars['numarts']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['pages']['show'] = true;
$this->_sections['pages']['max'] = $this->_sections['pages']['loop'];
$this->_sections['pages']['step'] = 1;
$this->_sections['pages']['start'] = $this->_sections['pages']['step'] > 0 ? 0 : $this->_sections['pages']['loop']-1;
if ($this->_sections['pages']['show']) {
    $this->_sections['pages']['total'] = $this->_sections['pages']['loop'];
    if ($this->_sections['pages']['total'] == 0)
        $this->_sections['pages']['show'] = false;
} else
    $this->_sections['pages']['total'] = 0;
if ($this->_sections['pages']['show']):

            for ($this->_sections['pages']['index'] = $this->_sections['pages']['start'], $this->_sections['pages']['iteration'] = 1;
                 $this->_sections['pages']['iteration'] <= $this->_sections['pages']['total'];
                 $this->_sections['pages']['index'] += $this->_sections['pages']['step'], $this->_sections['pages']['iteration']++):
$this->_sections['pages']['rownum'] = $this->_sections['pages']['iteration'];
$this->_sections['pages']['index_prev'] = $this->_sections['pages']['index'] - $this->_sections['pages']['step'];
$this->_sections['pages']['index_next'] = $this->_sections['pages']['index'] + $this->_sections['pages']['step'];
$this->_sections['pages']['first']      = ($this->_sections['pages']['iteration'] == 1);
$this->_sections['pages']['last']       = ($this->_sections['pages']['iteration'] == $this->_sections['pages']['total']);
?>
      <option value="<?php echo $this->_tpl_vars['articles'][$this->_sections['pages']['index']]['ID']; ?>
.art" <?php if ($this->_tpl_vars['item']['item'] == $this->_tpl_vars['articles'][$this->_sections['pages']['index']]['ID'] && $this->_tpl_vars['item']['type'] == 6): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['articles'][$this->_sections['pages']['index']]['title']; ?>
</option> 
     <?php endfor; endif; ?>	  
     </optgroup>
     <optgroup label="Sub Sites">
      <?php unset($this->_sections['pages']);
$this->_sections['pages']['name'] = 'pages';
$this->_sections['pages']['loop'] = is_array($_loop=$this->_tpl_vars['numsub']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['pages']['show'] = true;
$this->_sections['pages']['max'] = $this->_sections['pages']['loop'];
$this->_sections['pages']['step'] = 1;
$this->_sections['pages']['start'] = $this->_sections['pages']['step'] > 0 ? 0 : $this->_sections['pages']['loop']-1;
if ($this->_sections['pages']['show']) {
    $this->_sections['pages']['total'] = $this->_sections['pages']['loop'];
    if ($this->_sections['pages']['total'] == 0)
        $this->_sections['pages']['show'] = false;
} else
    $this->_sections['pages']['total'] = 0;
if ($this->_sections['pages']['show']):

            for ($this->_sections['pages']['index'] = $this->_sections['pages']['start'], $this->_sections['pages']['iteration'] = 1;
                 $this->_sections['pages']['iteration'] <= $this->_sections['pages']['total'];
                 $this->_sections['pages']['index'] += $this->_sections['pages']['step'], $this->_sections['pages']['iteration']++):
$this->_sections['pages']['rownum'] = $this->_sections['pages']['iteration'];
$this->_sections['pages']['index_prev'] = $this->_sections['pages']['index'] - $this->_sections['pages']['step'];
$this->_sections['pages']['index_next'] = $this->_sections['pages']['index'] + $this->_sections['pages']['step'];
$this->_sections['pages']['first']      = ($this->_sections['pages']['iteration'] == 1);
$this->_sections['pages']['last']       = ($this->_sections['pages']['iteration'] == $this->_sections['pages']['total']);
?>
      <option value="<?php echo $this->_tpl_vars['subsite'][$this->_sections['pages']['index']]['id']; ?>
.sub" <?php if ($this->_tpl_vars['item']['item'] == $this->_tpl_vars['subsite'][$this->_sections['pages']['index']]['id'] && $this->_tpl_vars['item']['type'] == 4): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['subsite'][$this->_sections['pages']['index']]['name']; ?>
</option> 
     <?php endfor; endif; ?>	  
     </optgroup>
     <optgroup label="Group Sites">
      <?php unset($this->_sections['pages']);
$this->_sections['pages']['name'] = 'pages';
$this->_sections['pages']['loop'] = is_array($_loop=$this->_tpl_vars['numgroups']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['pages']['show'] = true;
$this->_sections['pages']['max'] = $this->_sections['pages']['loop'];
$this->_sections['pages']['step'] = 1;
$this->_sections['pages']['start'] = $this->_sections['pages']['step'] > 0 ? 0 : $this->_sections['pages']['loop']-1;
if ($this->_sections['pages']['show']) {
    $this->_sections['pages']['total'] = $this->_sections['pages']['loop'];
    if ($this->_sections['pages']['total'] == 0)
        $this->_sections['pages']['show'] = false;
} else
    $this->_sections['pages']['total'] = 0;
if ($this->_sections['pages']['show']):

            for ($this->_sections['pages']['index'] = $this->_sections['pages']['start'], $this->_sections['pages']['iteration'] = 1;
                 $this->_sections['pages']['iteration'] <= $this->_sections['pages']['total'];
                 $this->_sections['pages']['index'] += $this->_sections['pages']['step'], $this->_sections['pages']['iteration']++):
$this->_sections['pages']['rownum'] = $this->_sections['pages']['iteration'];
$this->_sections['pages']['index_prev'] = $this->_sections['pages']['index'] - $this->_sections['pages']['step'];
$this->_sections['pages']['index_next'] = $this->_sections['pages']['index'] + $this->_sections['pages']['step'];
$this->_sections['pages']['first']      = ($this->_sections['pages']['iteration'] == 1);
$this->_sections['pages']['last']       = ($this->_sections['pages']['iteration'] == $this->_sections['pages']['total']);
?>
      <option value="<?php echo $this->_tpl_vars['groups'][$this->_sections['pages']['index']]['id']; ?>
.group" <?php if ($this->_tpl_vars['item']['item'] == $this->_tpl_vars['groups'][$this->_sections['pages']['index']]['id'] && $this->_tpl_vars['item']['type'] == 7): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['groups'][$this->_sections['pages']['index']]['teamname']; ?>
</option> 
     <?php endfor; endif; ?>	  
     </optgroup>
    <optgroup label="Side Boxes">
      <?php unset($this->_sections['function']);
$this->_sections['function']['name'] = 'function';
$this->_sections['function']['loop'] = is_array($_loop=$this->_tpl_vars['numfunc']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['function']['show'] = true;
$this->_sections['function']['max'] = $this->_sections['function']['loop'];
$this->_sections['function']['step'] = 1;
$this->_sections['function']['start'] = $this->_sections['function']['step'] > 0 ? 0 : $this->_sections['function']['loop']-1;
if ($this->_sections['function']['show']) {
    $this->_sections['function']['total'] = $this->_sections['function']['loop'];
    if ($this->_sections['function']['total'] == 0)
        $this->_sections['function']['show'] = false;
} else
    $this->_sections['function']['total'] = 0;
if ($this->_sections['function']['show']):

            for ($this->_sections['function']['index'] = $this->_sections['function']['start'], $this->_sections['function']['iteration'] = 1;
                 $this->_sections['function']['iteration'] <= $this->_sections['function']['total'];
                 $this->_sections['function']['index'] += $this->_sections['function']['step'], $this->_sections['function']['iteration']++):
$this->_sections['function']['rownum'] = $this->_sections['function']['iteration'];
$this->_sections['function']['index_prev'] = $this->_sections['function']['index'] - $this->_sections['function']['step'];
$this->_sections['function']['index_next'] = $this->_sections['function']['index'] + $this->_sections['function']['step'];
$this->_sections['function']['first']      = ($this->_sections['function']['iteration'] == 1);
$this->_sections['function']['last']       = ($this->_sections['function']['iteration'] == $this->_sections['function']['total']);
?>
      <?php if ($this->_tpl_vars['func'][$this->_sections['function']['index']]['type'] == 1): ?><option value="<?php echo $this->_tpl_vars['func'][$this->_sections['function']['index']]['id']; ?>
.box" <?php if ($this->_tpl_vars['item']['item'] == $this->_tpl_vars['func'][$this->_sections['function']['index']]['id'] && $this->_tpl_vars['item']['type'] == 3): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['func'][$this->_sections['function']['index']]['name']; ?>
</option><?php endif; ?>
      <?php endfor; endif; ?>
      </optgroup>
    </select></div><br />
    
     <div id="urldiv" style="display: <?php if ($this->_tpl_vars['item']['type'] != 5 && $this->_tpl_vars['action'] == 'edititem'): ?>none;<?php else: ?>'';<?php endif; ?>">
     <label for="url" class="label">External Address<span class="hintanchor" title="The address of the external website."><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/help.png" alt="[?]"/></span></label> 
     <div class="inputboxwrapper">http://<input name="url" type="text" id="url" value="<?php if ($this->_tpl_vars['item']['type'] == 5): ?><?php echo $this->_tpl_vars['item']['item']; ?>
<?php endif; ?>" class="inputbox" size="255" onblur="checkElement('url', 'text', true, 0, 0, '');" /><br /><span class="fieldError" id="urlError">Required</span></div><br />
     </div>
     
      <div id="optiondiv" style="display: <?php if (! $this->_tpl_vars['options'] || $this->_tpl_vars['action'] != 'edititem'): ?>none;<?php else: ?>'';<?php endif; ?>">
      <?php if ($this->_tpl_vars['options']): ?>
        <?php echo $this->_tpl_vars['options']; ?>

      <?php endif; ?>
     </div>
     
    <label for="target" class="label">Target<span class="hintanchor" title="How should the link be opened."><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/help.png" alt="[?]"/></span></label>
    <div class="inputboxwrapper"><select name="target" id="target" class="inputbox">
    <option value="" <?php if ($this->_tpl_vars['item']['target'] == ''): ?>selected="selected"<?php endif; ?>>Same Window</option>
    <option value="_blank" <?php if ($this->_tpl_vars['item']['target'] == '_blank'): ?>selected="selected"<?php endif; ?>>New Window</option>
    </select></div><br />
    </div>
    
    <div class="submitWrapper"><input type="submit" name="Submit" value="Submit" class="button" />
    <input name="Cancel" type="button" id="Cancel" value="Cancel" onclick="history.go(-1);" class="button" /></div>
  
   </fieldset>
</form>
 </div>
<?php elseif ($this->_tpl_vars['action'] == 'moveitem'): ?>
<div align="center">
 <form method="post" action="<?php echo $this->_tpl_vars['editFormAction']; ?>
" name="form">
 <fieldset class="formlist">
 <legend>Move item</legend>
 <div class="field">
 <label for="newcat" class="label">Location<span class="hintanchor" title="Where do you want to move the menu item too."><img src="<?php echo $this->_tpl_vars['tempdir']; ?>
admin/images/help.png" alt="[?]"/></span></label>
 <div class="inputboxwrapper"><select name="newcat" class="inputbox">
  <?php unset($this->_sections['loop']);
$this->_sections['loop']['name'] = 'loop';
$this->_sections['loop']['loop'] = is_array($_loop=$this->_tpl_vars['numcats']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['loop']['show'] = true;
$this->_sections['loop']['max'] = $this->_sections['loop']['loop'];
$this->_sections['loop']['step'] = 1;
$this->_sections['loop']['start'] = $this->_sections['loop']['step'] > 0 ? 0 : $this->_sections['loop']['loop']-1;
if ($this->_sections['loop']['show']) {
    $this->_sections['loop']['total'] = $this->_sections['loop']['loop'];
    if ($this->_sections['loop']['total'] == 0)
        $this->_sections['loop']['show'] = false;
} else
    $this->_sections['loop']['total'] = 0;
if ($this->_sections['loop']['show']):

            for ($this->_sections['loop']['index'] = $this->_sections['loop']['start'], $this->_sections['loop']['iteration'] = 1;
                 $this->_sections['loop']['iteration'] <= $this->_sections['loop']['total'];
                 $this->_sections['loop']['index'] += $this->_sections['loop']['step'], $this->_sections['loop']['iteration']++):
$this->_sections['loop']['rownum'] = $this->_sections['loop']['iteration'];
$this->_sections['loop']['index_prev'] = $this->_sections['loop']['index'] - $this->_sections['loop']['step'];
$this->_sections['loop']['index_next'] = $this->_sections['loop']['index'] + $this->_sections['loop']['step'];
$this->_sections['loop']['first']      = ($this->_sections['loop']['iteration'] == 1);
$this->_sections['loop']['last']       = ($this->_sections['loop']['iteration'] == $this->_sections['loop']['total']);
?>
   <?php if ($this->_tpl_vars['cats'][$this->_sections['loop']['index']]['id'] != $this->_tpl_vars['cat']['id']): ?><option value="<?php echo $this->_tpl_vars['cats'][$this->_sections['loop']['index']]['id']; ?>
"><?php echo $this->_tpl_vars['cats'][$this->_sections['loop']['index']]['name']; ?>
</option><?php endif; ?>
  <?php endfor; endif; ?>
 </select></div><br />
 </div>
 <div class="submitWrapper">
 <input type="Submit" name="Submit" id="Submit" value="Move" class="button" />&nbsp;<input type="button" value="Cancel" id="cancel" name="cancel" onclick="window.location = '<?php echo $this->_tpl_vars['pagename']; ?>
'" class="button" /></div>
 </fieldset>
 </form></div>
<?php endif; ?>